package cn.jdy.uum.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;

@Entity // 标识 实体 会自动映射表
public class Person implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id // 设置为主键
	@GeneratedValue(generator="system-uuid")
	@GenericGenerator(name="system-uuid", strategy = "uuid.hex")
	@Column(length=32)
	private String id;
	private Integer age;// 年龄
	private Double money;// 余额
	private Date birday;// 生日
	private Character sex;//0 1
	private Float oo;// 
  private String firstName;
	private String lastName;
	private String address;
	private String memo;
	private Long memo2;
	private Integer favorites;
	@ManyToOne(fetch = FetchType.LAZY) // 设置懒加载，只在使用这个数据的时候才发起查询
  @JoinColumn(name = "typeid")// person表 typeid 外键关联type表的id
	private Type type;

	@Transient
	private String typename;

  public Person() {
  }
  public Person(String id) {
    this.id = id;
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  public Integer getAge() {
    return age;
  }

  public void setAge(Integer age) {
    this.age = age;
  }

  public Double getMoney() {
    return money;
  }

  public void setMoney(Double money) {
    this.money = money;
  }

  public Date getBirday() {
    return birday;
  }

  public void setBirday(Date birday) {
    this.birday = birday;
  }

  public char getSex() {
    return sex;
  }

  public void setSex(char sex) {
    this.sex = sex;
  }

  public float getOo() {
    return oo;
  }

  public void setOo(float oo) {
    this.oo = oo;
  }

  public String getFirstName() {
    return firstName;
  }

  public void setFirstName(String firstName) {
    this.firstName = firstName;
  }

  public String getLastName() {
    return lastName;
  }

  public void setLastName(String lastName) {
    this.lastName = lastName;
  }

  public String getAddress() {
    return address;
  }

  public void setAddress(String address) {
    this.address = address;
  }

  public String getMemo() {
    return memo;
  }

  public void setMemo(String memo) {
    this.memo = memo;
  }

  public long getMemo2() {
    return memo2;
  }

  public void setMemo2(long memo2) {
    this.memo2 = memo2;
  }

  public int getFavorites() {
    return favorites;
  }

  public void setFavorites(int favorites) {
    this.favorites = favorites;
  }

  public String getTypename() {
    return typename;
  }

  public void setTypename(String typename) {
    this.typename = typename;
  }
	
	public Type getType() {
    return type;
  }

  public void setType(Type type) {
    this.type = type;
  }

   

}
